import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'

import Welcome from '@/components/Welcome'
import teacher from '../components/teacher/home'
import creat from '../components/teacher/kcgl/creat'
import edit from '../components/teacher/kcgl/edit'
import kcgl from '../components/teacher/kcgl/kcgl'
import upload from '../components/teacher/kcgl/upload'
import video from '../components/teacher/kcgl/video'
import work from '../components/teacher/kcgl/work'
import grade from '../components/teacher/stu/grade'
import homework from '../components/teacher/stu/homework'
import exp from '../components/teacher/stu/exp'
import persion from '../components/teacher/persion'
import application from '../components/admin/application'
import courses from '../components/admin/courses'
import register from '@/components/register'
import stuhome from '../components/student/stuhome'
import stuwork from '../components/student/stuwork'
import adminHome from '../components/admin/adminHome'
import stupersion from '../components/student/stupersion'
import stugrade from '../components/student/stugrade'
import stucourse from '../components/student/stucourse'
import coursemenu from '../components/student/coursemenu'
import stuview from "../components/teacher/stu/stuview"
import ccenter from "../components/teacher/kcgl/Coursecenter"
import test from "@/components/test"
import scourc from "../components/student/stucoursecenter.vue"
import stuworkview from "../components/student/stuworkview.vue"


Vue.use(Router)

export default new Router({
  routes: [
    // 下面都是固定的写法
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/test',
      name: 'test',
      component: test
    },
    {
      path: '/register',
      name: 'register',
      component: register
    },
    {
      path: '/stuhome',
      name: 'stuhome',
      component: stuhome,
      redirect: '/coursemenu',
      children: [
        {
          path: '/stuworkview',
          name: 'stuworkview',
          component: stuworkview,
        },
        {
          path: '/stuwork/:courseid',
          name: 'stuwork',
          component: stuwork,
        },
        {
          path: '/stupersion',
          name: 'stupersion',
          component: stupersion,
        },
        {
          path: '/stugrade',
          name: 'stugrade',
          component: stugrade,
        },
        {
          path: '/stucourse',
          name: 'stucourse',
          component: stucourse,
        },
        {
          path: '/coursemenu',
          name: 'coursemenu',
          component: coursemenu,
        },
        {
          path: '/stucoursecenter/:courseid',
          name: 'scourc',
          component: scourc,
        }
      ]
    },
    {
      path: '/adminHome',
      name: 'adminHome',
      component: adminHome
    },
    {
      path: '/adminHome',
      name: 'adminHome',
      component: adminHome,
      redirect: '/adminHome',
      children: [

        {
          path: '/application',
          name: 'application',
          component: application
        },
        {
          path: '/courses',
          name: 'courses',
          component: courses
        }
      ]
    },

    {
      path: '/adminHome',
      name: 'adminHome',
      component: adminHome
    },
    {
      path: '/adminHome',
      name: 'adminHome',
      component: adminHome,
      redirect: '/adminHome',
      children: [

        {
          path: '/application',
          name: 'application',
          component: application
        },
        {
          path: '/courses',
          name: 'courses',
          component: courses
        }
      ]
    },

    {
      path: '/teacher',
      name: 'Teacher',
      component: teacher,
      redirect: '/welcome',
      children: [
        {
          path: '/welcome',
          name: 'Welcome',
          component: Welcome
        },
        {
          path: '/creat',
          name: 'creat',
          component: creat
        },
        {
          path: '/edit/:id',
          name: 'edit',
          component: edit
        },
        {
          path: '/kcgl',
          name: 'kcgl',
          component: kcgl
        },
        {
          path: '/upload/:courseid',
          name: 'upload',
          component: upload
        },
        {
          path: '/video',
          name: 'video',
          component: video
        },
        {
          path: '/work',
          name: 'work',
          component: work
        },
        {
          path: '/grade',
          name: 'grade',
          component: grade
        },
        {
          path: '/homework',
          name: 'homework',
          component: homework
        },
        {
          path: '/exp',
          name: 'exp',
          component: exp
        },
        {
          path: '/persion',
          name: 'persion',
          component: persion
        },
        {
          path: '/stuview',
          name: 'stuview',
          component: stuview
        },
        {
          path: '/Coursecenter/:courseid',
          name: 'Coursecenter',
          component: ccenter

        }
      ]
    },

  ]
})
